/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model.universityUnits;

import model.Constants;
import model.entitys.NamedEntity;
import model.staff.Teacher;

/**
 *
 * @author Administrator
 */
public class Lesson extends NamedEntity<Group> {
    private Teacher teacher;

    public Lesson(Teacher teacher, String name) {
        super(name);
        this.teacher = teacher;
    }

    public Teacher getTeacher() {
        return teacher;
    }

    @Override
    public String toString() {
        final StringBuilder builder = new StringBuilder();
        
        builder.append("Lesson ");
        builder.append(getName());
        builder.append(Constants.LINE_SEPARATOR);
        builder.append("Groups: ");
        builder.append(Constants.LINE_SEPARATOR);
        
        for (int index = 0; index < size(); index++) {
            builder.append(get(index).getName());
        }
        
        return builder.toString();
    }
}